package com.xiaoc.bulldozer.common.util;

import java.net.URLDecoder;
import java.net.URLEncoder;

/**
 * describe:
 *
 * @author lihuancheng
 * @date 2018/9/7
 */
public class URLEncoderUtil {

    public static String encodeUtf8(String s) throws Exception{
        return URLEncoder.encode(s, "UTF-8");

    }

    public static void main(String[] args) throws Exception{
        System.out.println(encodeUtf8("xx案卷"));
        System.out.println(encodeUtf8(encodeUtf8("xx案卷")));
        System.out.println(URLDecoder.decode(encodeUtf8(encodeUtf8("xx案卷")), "utf-8"));

    }
}
